﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.QueryParameter
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using Microsoft.InfoCards.Diagnostics;
using System.Collections.Generic;

namespace Microsoft.InfoCards
{
  internal class QueryParameter
  {
    private string m_indexName;
    private List<IndexObject> m_objects;

    public QueryParameter(string name)
    {
      if (string.IsNullOrEmpty(name))
        throw InfoCardTrace.ThrowHelperArgumentNull(nameof (name));
      this.m_indexName = name;
      this.m_objects = new List<IndexObject>();
    }

    public QueryParameter(string name, params object[] values)
      : this(name)
    {
      for (int index = 0; index < values.Length; ++index)
        this.AddMatch(values[index]);
    }

    public string IndexName
    {
      get
      {
        return this.m_indexName;
      }
      internal set
      {
        this.m_indexName = value;
      }
    }

    internal IndexObject this[int index]
    {
      get
      {
        return this.m_objects[index];
      }
    }

    public int Count
    {
      get
      {
        return this.m_objects.Count;
      }
    }

    public void Clear()
    {
      this.m_objects.Clear();
    }

    public void AddCompiled(byte[] compiledForm)
    {
      this.m_objects.Add(new IndexObject(compiledForm));
    }

    public void AddMatch(params object[] values)
    {
      if (values == null || values.Length == 0)
        throw InfoCardTrace.ThrowHelperArgumentNull(nameof (values));
      this.m_objects.Add(new IndexObject(values));
    }
  }
}
